<?php

class Application_Form_EnvioAbsurdo extends Zend_Form
{

    public function init()
    {
        $this->setMethod('post');
        
        $this->addElement('text', 'autor', array(
            'label'     => 'Nome:',
            'required'  => true,
            'filters'   => array('StringTrim'),
            'validators'=> array(
                array('validator' => 'StringLength', 'options' => array(2, 45)))
        ));
        
        $this->addElement('text', 'autor_email', array(
           'label'      => 'E-mail:',
            'required'  => true,
            'filters'   => array('StringTrim'),
            'validators'=> array('EmailAddress',
                array('validator' => 'StringLength', 'options' => array(5, 45)))
        ));
        
        $this->addElement('textarea', 'frase', array(
            'label'     => 'Envie o absurdo:',
            'required'  => true,
            'validators'=> array(
                array('validator' => 'StringLength', 'options' => array(0, 500))
            )
        ));
        
        $this->addElement('captcha', 'captcha', array(
            'label'         => 'Digite os caracteres abaixo:',
            'required'      => true,
            'captcha'       => array(
                'captcha'   => 'Figlet',
                'wordLen'   => 6,
                'timeout'   => 300
            )
        ));
        
        $this->addElement('submit', 'submit', array(
           'ignore' => true,
            'label' => 'Enviar'
        ));
        
        // And finally add some CSRF protection
        /*$this->addElement('hash', 'csrf', array(
            'ignore' => true,
        ));*/
        
    }

}